<template>
  <div class="main-header">
    <div class="menu-icon" @click="handleMenuFold">
      <el-icon size="22">
        <component :is="isFold ? 'Expand' : 'Fold'"></component>
      </el-icon>
    </div>
    <div class="header-content">
      <Breadcrumb />
      <HeaderInfo />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import HeaderInfo from "@/components/main-header/c-cpns/HeaderInfo.vue";
import Breadcrumb from "@/components/main-header/c-cpns/Breadcrumb.vue";

const isFold = ref(false);
const emit = defineEmits(["update:isFold"]);
const handleMenuFold = () => {
  isFold.value = !isFold.value;
  emit("update:isFold", isFold.value);
};
</script>

<style scoped lang="less">
.main-header {
  height: 100%;
  display: flex;
  align-items: center;

  .menu-icon {
    cursor: pointer;
  }

  .header-content {
    margin: 0 20px 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
  }
}
</style>
